use super::hitls_cert_type::{HITLS_TrustedCAList, HITLS_TrustedCAType};
use super::hitls_crypt_type::{
    HITLS_AuthAlgo, HITLS_CRYPT_Key, HITLS_CipherAlgo, HITLS_HashAlgo, HITLS_KeyExchAlgo,
    HITLS_Lib_Ctx, HITLS_MacAlgo,
};
use super::hitls_type::{HITLS_Cipher, HITLS_Config, HITLS_Ctx};
pub const HITLS_VERSION_TLCP_DTLCP11: u32 = 257;
pub const HITLS_TLS_ANY_VERSION: u32 = 1023;
pub const HITLS_VERSION_SSL30: u32 = 768;
pub const HITLS_VERSION_TLS10: u32 = 769;
pub const HITLS_VERSION_TLS11: u32 = 770;
pub const HITLS_VERSION_TLS12: u32 = 771;
pub const HITLS_VERSION_TLS13: u32 = 772;
pub const HITLS_VERSION_TLS_MAJOR: u32 = 3;
pub const HITLS_DTLS_ANY_VERSION: u32 = 65024;
pub const HITLS_VERSION_DTLS12: u32 = 65277;
pub const HITLS_CFG_MAX_SIZE: u32 = 1024;
pub const TLS13_CIPHERSUITES_MAX_LEN: u32 = 80;
pub const HITLS_CLIENT_HELLO_SUCCESS: u32 = 1;
pub const HITLS_CLIENT_HELLO_FAILED: u32 = 0;
pub const HITLS_CLIENT_HELLO_RETRY: i32 = -1;
unsafe extern "C" {
    pub fn HITLS_CFG_NewDTLS12Config() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewDTLS12Config(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewTLCPConfig() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewTLCPConfig(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewDTLCPConfig() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewDTLCPConfig(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewTLS12Config() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewTLS12Config(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewTLS13Config() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewTLS13Config(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewTLSConfig() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewTLSConfig(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_NewDTLSConfig() -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ProviderNewDTLSConfig(
        libCtx: *mut HITLS_Lib_Ctx,
        attrName: *const ::std::os::raw::c_char,
    ) -> *mut HITLS_Config;
}
unsafe extern "C" {
    pub fn HITLS_CFG_FreeConfig(config: *mut HITLS_Config);
}
unsafe extern "C" {
    pub fn HITLS_CFG_UpRef(config: *mut HITLS_Config) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetVersion(config: *mut HITLS_Config, minVersion: u16, maxVersion: u16)
        -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetVersionForbid(config: *mut HITLS_Config, noVersion: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetRenegotiationSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetClientRenegotiateSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetLegacyRenegotiateSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetResumptionOnRenegoSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetClientVerifySupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetNoClientCertSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetExtenedMasterSecretSupport(config: *mut HITLS_Config, support: bool)
        -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetDhAutoSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetTmpDh(config: *mut HITLS_Config, dhPkey: *mut HITLS_CRYPT_Key) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetRenegotiationSupport(
        config: *const HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetClientVerifySupport(config: *mut HITLS_Config, isSupport: *mut bool)
        -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetNoClientCertSupport(config: *mut HITLS_Config, isSupport: *mut bool)
        -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetExtenedMasterSecretSupport(
        config: *mut HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetDhAutoSupport(config: *mut HITLS_Config, isSupport: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetPostHandshakeAuthSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetPostHandshakeAuthSupport(
        config: *mut HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetVerifyNoneSupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetVerifyNoneSupport(config: *mut HITLS_Config, isSupport: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetClientOnceVerifySupport(config: *mut HITLS_Config, support: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetClientOnceVerifySupport(
        config: *mut HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetCipherSuites(
        config: *mut HITLS_Config,
        cipherSuites: *const u16,
        cipherSuitesSize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ClearTLS13CipherSuites(config: *mut HITLS_Config) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetEcPointFormats(
        config: *mut HITLS_Config,
        pointFormats: *const u8,
        pointFormatsSize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetGroups(
        config: *mut HITLS_Config,
        groups: *const u16,
        groupsSize: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetSignature(
        config: *mut HITLS_Config,
        signAlgs: *const u16,
        signAlgsSize: u16,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_AddCAIndication(
        config: *mut HITLS_Config,
        caType: HITLS_TrustedCAType,
        data: *const u8,
        len: u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCAList(config: *const HITLS_Config) -> *mut HITLS_TrustedCAList;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetCAList(config: *mut HITLS_Config, list: *mut HITLS_TrustedCAList) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ClearCAList(config: *mut HITLS_Config);
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetKeyExchMode(config: *mut HITLS_Config, mode: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetKeyExchMode(config: *mut HITLS_Config) -> u32;
}
pub type HITLS_ClientHelloCb = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut HITLS_Ctx,
        alert: *mut i32,
        arg: *mut ::std::os::raw::c_void,
    ) -> i32,
>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetClientHelloCb(
        config: *mut HITLS_Config,
        callback: HITLS_ClientHelloCb,
        arg: *mut ::std::os::raw::c_void,
    ) -> i32;
}
pub type HITLS_DtlsTimerCb =
    ::std::option::Option<unsafe extern "C" fn(ctx: *mut HITLS_Ctx, us: u32) -> u32>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetDtlsTimerCb(config: *mut HITLS_Config, callback: HITLS_DtlsTimerCb) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMinVersion(config: *const HITLS_Config, minVersion: *mut u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMaxVersion(config: *const HITLS_Config, maxVersion: *mut u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherId(
        cipher: *const HITLS_Cipher,
        cipherAlg: *mut HITLS_CipherAlgo,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetHashId(cipher: *const HITLS_Cipher, hashAlg: *mut HITLS_HashAlgo) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMacId(cipher: *const HITLS_Cipher, macAlg: *mut HITLS_MacAlgo) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetAuthId(cipher: *const HITLS_Cipher, authAlg: *mut HITLS_AuthAlgo) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetKeyExchId(
        cipher: *const HITLS_Cipher,
        kxAlg: *mut HITLS_KeyExchAlgo,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherSuiteName(cipher: *const HITLS_Cipher) -> *const u8;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherSuiteStdName(cipher: *const HITLS_Cipher) -> *const u8;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherSuiteByStdName(stdName: *const u8) -> *const HITLS_Cipher;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetDescription(cipher: *const HITLS_Cipher, buf: *mut u8, len: i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CIPHER_IsAead(cipher: *const HITLS_Cipher, isAead: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherVersion(cipher: *const HITLS_Cipher, version: *mut i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherByID(cipherSuite: u16) -> *const HITLS_Cipher;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherSuite(cipher: *const HITLS_Cipher, cipherSuite: *mut u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetVersionSupport(config: *const HITLS_Config, version: *mut u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetVersionSupport(config: *mut HITLS_Config, version: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetNeedCheckPmsVersion(config: *mut HITLS_Config, needCheck: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetQuietShutdown(config: *mut HITLS_Config, mode: i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetQuietShutdown(config: *const HITLS_Config, mode: *mut i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetDtlsPostHsTimeoutVal(config: *mut HITLS_Config, timeoutVal: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetEncryptThenMac(config: *mut HITLS_Config, encryptThenMacType: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetEncryptThenMac(
        config: *const HITLS_Config,
        encryptThenMacType: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetConfigUserData(config: *const HITLS_Config) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetConfigUserData(
        config: *mut HITLS_Config,
        userData: *mut ::std::os::raw::c_void,
    ) -> i32;
}
pub type HITLS_ConfigUserDataFreeCb =
    ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetConfigUserDataFreeCb(
        config: *mut HITLS_Config,
        callback: HITLS_ConfigUserDataFreeCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_IsDtls(config: *const HITLS_Config, isDtls: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetCipherServerPreference(config: *mut HITLS_Config, isSupport: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetCipherServerPreference(
        config: *const HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetFlightTransmitSwitch(config: *mut HITLS_Config, isEnable: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetFlightTransmitSwitch(
        config: *const HITLS_Config,
        isEnable: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetDtlsCookieExchangeSupport(
        config: *mut HITLS_Config,
        isSupport: bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetDtlsCookieExchangeSupport(
        config: *const HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetEmptyRecordsNum(config: *mut HITLS_Config, emptyNum: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetEmptyRecordsNum(config: *const HITLS_Config, emptyNum: *mut u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetMaxSendFragment(config: *mut HITLS_Config, maxSendFragment: u16) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMaxSendFragment(
        config: *const HITLS_Config,
        maxSendFragment: *mut u16,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetRecInbufferSize(config: *mut HITLS_Config, recInbufferSize: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetRecInbufferSize(
        config: *const HITLS_Config,
        recInbufferSize: *mut u32,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetMaxCertList(config: *mut HITLS_Config, maxSize: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMaxCertList(config: *const HITLS_Config, maxSize: *mut u32) -> i32;
}
pub type HITLS_DhTmpCb = ::std::option::Option<
    unsafe extern "C" fn(ctx: *mut HITLS_Ctx, isExport: i32, keyLen: u32) -> *mut HITLS_CRYPT_Key,
>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetTmpDhCb(config: *mut HITLS_Config, callback: HITLS_DhTmpCb) -> i32;
}
pub type HITLS_RecordPaddingCb = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut HITLS_Ctx,
        type_: i32,
        length: u64,
        arg: *mut ::std::os::raw::c_void,
    ) -> u64,
>;
unsafe extern "C" {
    pub fn HITLS_CFG_SetRecordPaddingCb(
        config: *mut HITLS_Config,
        callback: HITLS_RecordPaddingCb,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetRecordPaddingCb(config: *mut HITLS_Config) -> HITLS_RecordPaddingCb;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetRecordPaddingCbArg(
        config: *mut HITLS_Config,
        arg: *mut ::std::os::raw::c_void,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetRecordPaddingCbArg(
        config: *mut HITLS_Config,
    ) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetCheckKeyUsage(config: *mut HITLS_Config, isCheck: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetReadAhead(config: *mut HITLS_Config, onOff: i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetReadAhead(config: *mut HITLS_Config, onOff: *mut i32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetModeSupport(config: *mut HITLS_Config, mode: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_ClearModeSupport(config: *mut HITLS_Config, mode: u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetModeSupport(config: *const HITLS_Config, mode: *mut u32) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetMiddleBoxCompat(config: *mut HITLS_Config, isMiddleBox: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetMiddleBoxCompat(config: *mut HITLS_Config, isMiddleBox: *mut bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_SetEndPoint(config: *mut HITLS_Config, isClient: bool) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetResumptionOnRenegoSupport(
        config: *mut HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_GetClientRenegotiateSupport(
        config: *mut HITLS_Config,
        isSupport: *mut bool,
    ) -> i32;
}
unsafe extern "C" {
    pub fn HITLS_CFG_EnableTls13SM(config: *mut HITLS_Config, isOnlySupportSM: bool) -> i32;
}
